package com.yang.controller;

import com.yang.common.ResponseResult;
import com.yang.service.AliRocketMQService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/ali-rocketmq")
@RestController
@Slf4j
@Api(tags = "阿里云消息队列RocketMQ接口")
public class AliRocketMQController {

    @Autowired
    private AliRocketMQService aliRocketMQService;

    @GetMapping("/sendMessage")
    @ApiOperation(value = "测试")
    public ResponseResult sendMessage(String messageType) {
        log.info("接收到发送消息请求...");
        aliRocketMQService.sendFireData(messageType);
        return ResponseResult.successResult("消息发送成功");
    }

}
